package BehavioralMode.memento.whiteBox.gameFile;

/**
 * 备忘录白盒模式
 * */
public class Cilent {
    public static void main(String[] args) {
          Originator originator = new Originator();
          originator.initStatus();
          originator.showStatus();


          originator.attackBoss();
          originator.showStatus();

          System.out.println("保存状态");
          Caretaker caretaker = new Caretaker();
          caretaker.saveStatus("第一次攻击状态",originator.createMemnto());

          originator.attackBoss();
          originator.showStatus();
          originator.attackBoss();
          originator.showStatus();

          System.out.println("恢复存档");
          originator.restore(caretaker.getStatus("第一次攻击状态"));
          originator.showStatus();

    }
}
